<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>[attribute*=value]</title>
    <script src = 'jquery-1.12.4.min.js'></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .bord{
            border: 1px dashed #ee2602;
            width: 90%;
            margin: 20px auto;
        }
        .title{
            font-size: 20px;
            font-weight: bold;
            margin: 20px;
        }
        .introduce{
            font-size: 16px;
            margin: 0 0 20px 50px;
        }
        .red{
            color: red;
        }
    </style>
    <script>
        jQuery(function ($) {
            $('#mybtn').click(function () {
                $("input[name*='man']").css({backgroundColor:'red'})
            })
        });
    </script>
</head>
<body>
<div class="bord">
    <div class="title">[attribute*=value]</div>
    <div class="introduce">匹配给定的属性是以包含某些值的元素</div>
</div>
<div class="bord">
    <div class="title">演示效果</div>
    <div class="introduce">
        <input name="man-news" value="name:man-news"/>
        <input name="milkman" value="name:milkman"/>
        <input name="letterman2" value="name:letterman2"/>
        <input name="newmilk" value="name:newmilk"/>
        <br/>
        <br/>
        <button id="mybtn">查找所有 name 中有 'man' 开始的 input 元素，背景变红色。</button>
    </div>
</div>
<div class="bord">
    <div class="title">代码</div>
    <div class="introduce">
            <pre>
&lt;script&gt;
    jQuery(function ($) {
            $('#mybtn').click(function () {
                $("input<a class="red">[name*='man']<a/>").css({backgroundColor:'red'})
            })
        });
&lt;/script&gt;
&lt;div class="introduce"&gt;
    &lt;input name="man-news" value="name:man-news"/&gt;
    &lt;input name="milkman" value="name:milkman"/&gt;
    &lt;input name="letterman2" value="name:letterman2"/&gt;
    &lt;input name="newmilk" value="name:newmilk"/&gt;
    &lt;br/&gt;
    &lt;br/&gt;
    &lt;button id="mybtn"&gt;查找所有 name 中有 'man' 开始的 input 元素，背景变红色。&lt;/button&gt;
&lt;/div&gt;
            </pre>
    </div>
</div>
</body>
</html>